﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link href="/static/plugins/layui/css/layui.css" rel="stylesheet"/>
    <link href="/static/css/public.css" rel="stylesheet"/>
</head>
<body class="childrenBody">
<form class="layui-form layui-row changePwd">
    <blockquote class="layui-elem-quote quoteBox">
        <div class="layui-inline">
            <a class="layui-btn" href="{% url 'home:home_page' %}">返回首页</a>
        </div>
    </blockquote>
    <div class="layui-col-xs12 layui-col-sm6 layui-col-md6">
        <div class="layui-input-block layui-red pwdTips" style="font-size:20px; color:#000 !important;">个人资料</div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="text" value="{{ user.username }}" disabled class="layui-input layui-disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" id="txtUserName" value="{{ userInfo.account }}" class="layui-input"
                       autocomplete="off"
                       aria-autocomplete="none" maxlength="12"/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机</label>
            <div class="layui-input-block">
                <input type="text" id="txtPhone" value="{{ userInfo.phone }}" class="layui-input" autocomplete="off"
                       aria-autocomplete="none" maxlength="11"/>
            </div>
        </div>
        <div class="layui-form-item userAddress">
            <label class="layui-form-label">住址</label>
            <div class="layui-input-inline">
                <select name="province" lay-filter="province" class="province">
                    <option value="">请选择市</option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="city" lay-filter="city" disabled>
                    <option value="">请选择市</option>
                </select>
            </div>
            <div class="layui-input-inline">
                <select name="area" lay-filter="area" disabled>
                    <option value="">请选择县/区</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">详细地址</label>
            <div class="layui-input-block">
                <input type="text" id="txtAddr" value="{{ userInfo.address }}" class="layui-input" autocomplete="off"
                       aria-autocomplete="none"
                       maxlength="50"/>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit="" lay-filter="changeInfo">立即修改</button>
            </div>
        </div>
    </div>

    <input type="hidden" id="hideUserID" value="{{ userInfo.id }}"/>

    <div class="layui-col-xs12 layui-col-sm4 layui-col-md4">
        <div class="layui-input-block layui-red pwdTips" style="font-size:20px; color:#000 !important;">用户头像</div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-upload-list thumbBox mag0 magt3" style="height: 300px">
                    {% if userInfo.imgSrc %}
                        <img class="layui-upload-img thumbImg" src="/media/{{ userInfo.imgSrc }}" name="imgSrc"
                             id="imgSrc">
                    {% else %}
                        <img class="layui-upload-img thumbImg" name="imgSrc" id="imgSrc">
                    {% endif %}
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-filter="addImg" id="btnSubmit" lay-submit>提交</button>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript">
    var current_province =
        {% if userInfo.province %}
            {{ userInfo.province }}
        {% else %}
            ""
        {% endif %};
    var current_city =
        {% if userInfo.city %}
            {{ userInfo.city }}
        {% else %}
            ""
        {% endif %};
    var current_area =
        {% if userInfo.area %}
            {{ userInfo.area }}
        {% else %}
            ""
        {% endif %};
</script>
<script src="/static/plugins/layui/layui.js"></script>
<script src="/static/js/User/UserInfo.js"></script>
</body>
</html>
